import requests
import app


class CommAIP:
    def __init__(self, data):
        self.url = app.BASE_URL + data.get("api")
        self.method = data.get("method")
        self.data = data
        print(self.url, self.method, self.data)

    def get_response(self):
        if self.method == "get":
            pass
        elif self.method == "post":
            response = requests.post(url=self.url, headers=app.REQUEST_HEADER, json=self.data, verify=False)
            return response
        elif self.method == "put":
            pass
        elif self.method == "delete":
            pass
